/**
 *
 * Copyright 2012 Snda, Inc. All rights reserved.
 * FrameChooseActivity.java
 *
 */
package com.magic.babyphotos;

import com.magic.babyphotos.adapter.ImageAdapter;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;

/**
 * @author jinjiashun(jinjiashun@snda.com)
 * @date 2012-1-10
 */
public class FrameChooseActivity extends BaseActivity
{
   
    
    public void onCreate(Bundle bundle)
    {
        super.onCreate(bundle);
        setContentView(R.layout.frame_layout);

        GridView grid = (GridView) findViewById(R.id.frame_grid);
        grid.setAdapter(new ImageAdapter(this, AppConstants.FRAME_IMAGE_SMALL_IDS));
        grid.setOnItemClickListener(new OnItemClickListener()
        {

            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position,
                    long id)
            {
                // TODO Auto-generated method stub
                Intent intent = new Intent(FrameChooseActivity.this, EditActivity.class);
                intent.setAction(AppConstants.ACTION_SELECT_FRAME);
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                intent.putExtra(AppConstants.KEY_SELECTED_FRAME, position);
                startActivity(intent);
            }
        });
        // ArrayAdapter<>
        // grid.setAdapter(new )
    }

}
